1. Field of the Invention
This invention generally relates to a displacement detection apparatus and method and, more particularly, to a displacement detection apparatus and method that can adaptively adjust the size of comparison blocks.
2. Description of the Related Art
A conventional optical mouse continuously captures images of a working surface with an image sensor and compares the correlation between a reference frame and a current frame sensed by the sensor array of the image sensor in a sampling period to calculate a displacement. After the displacement is obtained, the current frame is updated to a new reference frame and the correlation between the updated reference frame and a newly captured current frame will be compared in the next sampling period so as to obtain a next displacement. However, the aforementioned displacement detection method has the problem of being unable to detect small displacement and low detection accuracy.
Please refer to FIG. 1, it shows a displacement detection method capable of detecting small displacement and disclosed in U.S. Pat. No. 7,167,161. In a first sampling period, an image sensor captures a first current frame 92 to be stored in a storage unit. In the meanwhile, a reference frame 91 has been stored in the storage unit, wherein the reference frame 91 is an image frame captured by the image sensor in a sampling period previous to the first sampling period. A first reference block 91a is set for comparing the correlation. Next, a processing unit sequentially searches the first current frame 92 from the top left to the right bottom to find the position of a first search block 92a having the highest correlation with the first reference block 91a, and then calculates a position difference therebetween. For example in FIG. 1, the position difference between the first search block 92a in the first current frame 92 and the first reference block 91a in the reference frame 91 is three pixels upward. In a second sampling period, the image sensor captures a second current frame 93 to be stored in the storage unit. At this moment, only the reference block is updated and the reference frame is not, wherein the second reference block 91b is obtained from shifting the first reference block 91a three pixels downward and it is in the reverse direction of the position difference obtained in the first sampling period. Then, the processing unit sequentially searches the second current frame 93 from the top left to the right bottom to find the position of a second search block 93a having the highest correlation with the second reference block 91b, and then calculates a position difference therebetween. In this conventional displacement detection method, an accumulation of small displacement can be detected so as to detect small angle movement by updating the position of reference block rather than updating the reference frame according to the position difference obtained in a previous sampling period.
The present invention further provides a displacement detection apparatus and method that has higher stability and can utilize the sensor array with a smaller size.